package com.gitee.cirnochat.common.config;

import com.gitee.cirnochat.chatai.client.SparkChatModel;
import lombok.Data;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties("spark.model")
@Data
public class SparkModelConfig {
    private String baseUrl;

    private String apiKey;

    private String model;

    @Bean(name = "sparkChatClient")
    public ChatClient sparkChatClient() {
        return ChatClient.builder(new SparkChatModel(baseUrl,apiKey,model)).build();
    }
}
